package com.hx.dc.controllor;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.github.pagehelper.PageInfo;

@Controller
@RequestMapping("/base")
public class BaseAction {
	
	@Autowired
	ServletContext application;
	
	@RequestMapping(value="/goURL")
	public String login(String url){
		//System.out.println(url);
		
		return "forward:/WEB-INF/"+url+".jsp";
	}

	
	public Map<String , Object> getPage(PageInfo pageInfo){			
		Map<String , Object> pageMap = new HashMap<String, Object>();
		pageMap.put("total", pageInfo.getTotal());
		pageMap.put("rows", pageInfo.getList());
			
		return pageMap;
	}
}
